package demo.equals;

import com.spire.ms.System.Collections.ArrayList;
import org.apache.commons.collections4.CollectionUtils;
import org.junit.jupiter.api.Test;

import java.util.Collection;
import java.util.List;

/**
 * 2022/5/13 15:22
 *
 * @author by yd
 */
public class Demo {
	@Test
	public void equals() {
		Son a = new Son().setAge(1).setName("a").setId("1");
		Son b = new Son().setAge(1).setName("a").setId("1");
		System.out.println(a.equals(b));
		List<Son> list = new ArrayList();
		// list.add(new Son().setAge(1).setName("a").setId("1"));
		// list.add(new Son().setAge(1).setName("c").setId("3"));
		// list.add(new Son().setAge(1).setName("b").setId("2"));

		List<Son> blist = new ArrayList();
		blist.addAll(list);
		// blist.add(new Son().setAge(1).setName("d").setId("4"));


		Collection<Son> subtract = CollectionUtils.subtract(blist, list);
		System.out.println(subtract);


	}
}
